
const { find,add,update,singlePerson} = require('../model/quoteModel')


//获取
const getQuote=async(req,res,next)=>{
    const result = await find(req.query);
    
    if (result.length||result.length===0) {
        res.send({ httpStatus: 200,  total: result.length, data: result })
    } else {
        res.send({ httpStatus: 400,  msg: '查询出错' })
    }
}


//新增
const writeQuote=async (req,res,next)=>{
    const result=await add(req.body)
    if(result){
        res.send({httpStatus:200,msg:'增加成功',data:result})
    }else{
        res.send({httpStatus:400,msg:'增加出错'})
    }
}




module.exports = {
    getQuote,
    writeQuote,
}